package model.xmlconvert;

import nu.xom.Element;

public class ModelLinkFlowChartComponent extends ModelFlowChartComponent{

	public enum ArrowType {
		DEFAULT, YES, NO
	}

	ModelFlowChartComponent to;
	private ArrowType arrowType;
	private ModelFlowChartComponent from ;
	
	public ModelLinkFlowChartComponent(String label, ModelFlowChartComponent from, ModelFlowChartComponent to) {
		this(label, from ,to , ArrowType.DEFAULT);
	}

	public ModelLinkFlowChartComponent(String label,
			ModelFlowChartComponent from, ModelFlowChartComponent to, ArrowType type) {
		super(label);
		this.to = to;
		this.from = from;
		this.arrowType = type;
	}

	@Override
	public Element getXML() {	
		Element link = new Element("link");
		link.appendChild(to.getLabel());
		return link;
	}

	@Override
	public boolean addComponentConnection(ModelFlowChartComponent m) {		
		return false;
	}

	@Override
	public boolean setOperation(String operation) {
		return false;
	}

	public ModelFlowChartComponent getDestination() {
		return to;
	}
	
	public ModelFlowChartComponent getBegin() {
		return from;
	}
	
	public ArrowType getArrowType(){
		return this.arrowType;
	}
}